﻿using Bricks.Business.Models.Account;
using Bricks.Component.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Bricks.Business.Models.Account
{
    [Description("MenuInfo")]
    public class MenuInfo : EntityBase<Guid>
    {
        public MenuInfo()
        {
            ID = GuidHelper.NewGuid();
        }

        [Required]
        [StringLength(32)]
        [Description("菜单名称")]
        [Display(Name = "菜单名称")]
        public string MenuName { get; set; }

        [StringLength(64)]
        [Description("菜单编码")]
        [Display(Name = "菜单编码")]
        public string MenuCode { get; set; }

        [StringLength(1024)]
        [Description("菜单链接")]
        [Display(Name = "菜单链接")]
        public string Url { get; set; }

        [StringLength(1024)]
        [Description("图标")]
        [Display(Name = "图标")]
        public string Icon { get; set; }

        public MenuType MenuType
        {
            get
            {
                return (MenuType)MenuTypeNum;
            }
            set
            {
                MenuTypeNum = (int)value;
            }
        }

        [Description("菜单类型（0：NULL，1：Tab，2：Dialog，3：内嵌[保留]）")]
        [Display(Name = "类型")]
        public int MenuTypeNum { get; set; }

        [Description("父节点ID")]
        [Display(Name = "父节点ID")]
        public Guid? PID { get; set; }

        [Display(Name = "排序")]
        public int OrderNo { get; set; }

        [StringLength(1024)]
        [Display(Name = "描述")]
        public string Description { get; set; }

        [Display(Name = "宽度")]
        public int? Width { get; set; }

        [Display(Name = "高度")]
        public int? Height { get; set; }

        [Display(Name = "模态")]
        public bool? Modal { get; set; }

        #region Collection
        //public virtual ICollection<UserInfo> Users { get; set; }

        //public virtual ICollection<ActionInfo> Actions { get; set; }
        #endregion
    }
}
